package com.sky.controller.user;

import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;
/*
注册不同的RestController，后面UserShopController
 */
@RestController("UserShopController")
@RequestMapping("user/shop")
@Api(tags = "店铺营业接口")
public class ShopController {

    @Autowired
    private RedisTemplate redisTemplate;
    private final static String KEY="SHOP_STATUS";

@ApiOperation("获取店铺营业状态")
@GetMapping("/status")

public Result<Integer> GetShopStatus(){
    Integer sta=(Integer) redisTemplate.opsForValue().get(KEY);
    return Result.success(sta);
}



}
